
import util from "../../utils/util.js";
import api from "../../api/api.js";
//index.js
//获取应用实例
var app = getApp()
Page({
  data:{
    Page:true,
    pg:true,
     imgUrls: [
      'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
      'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
      'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
    ],
    info: util.JSONdata.tabfour.companyInfo
     
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
 
  },
  onReady:function(){
    // 页面渲染完成
    setInterval(this.interVal, 1000);
  },
  onShow:function(){
    // 页面显示
   
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  },
  handleTapImage:function (event) {
    //图片点击、
    console.log(event);
    wx.navigateTo({
      url:'../../pages/posts/posts',
      success:function(res){

      },
      fail:function(){

      },
      complete:function(){

      }
    })
  },
  callMobile(num){
   var num=this.data.info.phone;
    wx.makePhoneCall({
      phoneNumber: num
    })
  
  },
  interVal() {
    var got = Date.parse(new Date()) / 1000;

    if (got > util.heal) {

      this.setData({
        Page: false,
        pg: true
      })
    }else{
      this.setData({
        Page: true,
        pg: false
      })
    }
  }
})